import request from '@/utils/request'
import type { PageParam, ResponseData } from '../commonType'

enum API {
  GETINFO_URL = '/sys/setting/getInfo',
  UPDATE_URL = '/sys/setting/update',
  HISTORY_URL = '/sys/settingHistory/getPage',
  updateContent_URL = '/sys/setting/updateContent',
  downLoadFile_URL = '/download',
  
  companyGet_URL = '/t-company-information/get',
}

export function settingGetInfo() {
  return request.get<any, ResponseData>(API.GETINFO_URL)
}

export function settingUpdate(data: any) {
  return request.put<any, ResponseData>(API.UPDATE_URL, data)
}

export function settingHistory(data: any) {
  return request.get<any, ResponseData>(API.HISTORY_URL, data)
}

export function updateContent(data: any) {
  return request.put<any, ResponseData>(API.updateContent_URL, data)
}


export function downLoadFile(path) {
  return request.get<any, ResponseData>(`${API.downLoadFile_URL}/${path}`, { withCredentials: false, responseType: "arraybuffer" })
}

export function companyGet() {
  return request.get<any, ResponseData>(API.companyGet_URL)
}
